﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MethodWorx.CMS.Requests;
using MethodWorx.CMS.Services;
using MethodWorx.Core.DomainModel;
using MethodWorx.CMS.Content;

namespace MethodWorx.CMS.UI.Models
{
    public class PageSystemModel
    {
        public UpdatePageRequest Request { get; private set; }

        public PageSystemModel(Guid id, ContentService service)
            : this(service.GetPageById(id))
        {
        }

        public PageSystemModel(Page page)
        {
            if (page == null)
                throw new BusinessRuleException("Page Not Found");

            this.Request = new UpdatePageRequest(page);
        }
    }
}